var couponArray = JSON.parse(sessionStorage.getItem("couponArray"))
console.log(couponArray)

//统计模块 -------------------
var chartDom2 = document.getElementById('cake');
var myChart2 = echarts.init(chartDom2);
// var myChart2 = echarts.init(chartDom2, 'dark');
var option2;
option2 = {
    title: {
        text: 'Weekly Info',
        subtext: 'Cookie Data',
        left: 'center'
    },
    tooltip: {
        trigger: 'item'
    },
    legend: {
        orient: 'vertical',
        left: 'left'
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    series: [
        {
            name: 'Week用户统计',
            type: 'pie',
            radius: '50%',
            data: [
                { value: couponArray[0] , name: '商品优惠劵' },
                { value: couponArray[1], name: '课程优惠劵' },
                { value: couponArray[2], name: '无限制优惠劵' },
            ],
            emphasis: {
                itemStyle: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};
option2 && myChart2.setOption(option2);



